package com.lottery.service;

import com.lottery.dao.WinningHistoriesDao;
import com.lottery.pojo.TableWinningHistories;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WinningHistoriesService {

    @Autowired
    WinningHistoriesDao winningHistoriesDao;

    public List<TableWinningHistories> getOrdersByDateRange(String machine_number, String startTime, String endTime) {
        return winningHistoriesDao.getOrdersByDateRange(machine_number, startTime, endTime);
    }

    public List<TableWinningHistories> getPrizesFromWinningHistory(String machine_number, int region_id, String prizes_type, int rank, int digit, String startTime, String endTime) {
        return winningHistoriesDao.getPrizesFromWinningHistory(machine_number, region_id, prizes_type, rank, digit, startTime, endTime);
    }

    ///
    public void deleteById(int id) {
        winningHistoriesDao.deleteById(id);
    }

    public void update(int bet_number_id, String prizes_type, double prizes) {
        winningHistoriesDao.update(bet_number_id, prizes_type, prizes);
    }

    public void add(TableWinningHistories history) {
        winningHistoriesDao.add(history);
    }

    public List<TableWinningHistories> getByBetNumberId(int bet_number_id) {
        return winningHistoriesDao.getByBetNumberId(bet_number_id);
    }
}
